From 4c94a76237446f22646a5367bdf48b6b13eeff92 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Mon, 6 Aug 2018 16:15:48 +0900 Subject: [PATCH] font chooser widget: Add missing build flags If we detect HarfBuzz and PangoFT2, GtkFontChooserWidget uses them. So we need to add CFLAGS and LIBS of them to GTK_DEP_CFLAGS/LIBS. If we don't add them, MinGW build fails to link. --- configure.ac | 29 ++++++++++++++++------------- demos/gtk-demo/Makefile.am | 5 ----- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index c729f5c5ac..aadaa560ad 100644 --- a/configure.ac +++ b/configure.ac @@ -1426,6 +1426,22 @@ if test x"$os_win32" = xyes; then GTK_EXTRA_CFLAGS="$msnative_struct" fi +################################################## +# Check for harfbuzz and pangoft2 +################################################## + +PKG_CHECK_MODULES(GTK_FONT_CHOOSER_WIDGET, + harfbuzz >= 0.9 pangoft2, + build_font_demo=yes, + build_font_demo=no) +AM_CONDITIONAL(BUILD_FONT_DEMO, [ test "x$build_font_demo" = xyes ]) +if test "x$build_font_demo" = xyes; then + AC_DEFINE([HAVE_HARFBUZZ], 1, [defines whether we have HarfBuzz]) + AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2]) + GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $GTK_FONT_CHOOSER_WIDGET_CFLAGS" + GTK_DEP_LIBS="$GTK_DEP_LIBS $GTK_FONT_CHOOSER_WIDGET_LIBS" +fi + if $PKG_CONFIG --exists x11; then X11_PREFIX="`$PKG_CONFIG --variable=prefix x11`" elif test x"$prefix" != xNONE; then @@ -1777,19 +1793,6 @@ if test "$have_colord" = "yes"; then fi AM_CONDITIONAL(HAVE_COLORD, test "x$have_colord" = "xyes") -################################################## -# Check for harfbuzz and pangoft2 -################################################## - -PKG_CHECK_MODULES(FONTDEMO, harfbuzz >= 0.9 pangoft2, build_font_demo=yes, build_font_demo=no) -AC_SUBST(FONTDEMO_CFLAGS) -AC_SUBST(FONTDEMO_LIBS) -AM_CONDITIONAL(BUILD_FONT_DEMO, [ test "x$build_font_demo" = xyes ]) -if test "x$build_font_demo" = xyes; then - AC_DEFINE([HAVE_HARFBUZZ], 1, [defines whether we have HarfBuzz]) - AC_DEFINE([HAVE_PANGOFT], 1, [defines whether we have pangoft2]) -fi - ################################################## # Checks for gtk-doc and docbook-tools ################################################## diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index 64245b4b6e..c8529e5bf7 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -104,11 +104,6 @@ LDADDS = \ $(GDK_DEP_LIBS) \ -lm -if BUILD_FONT_DEMO -AM_CPPFLAGS += $(FONTDEMO_CFLAGS) -LDADDS += $(FONTDEMO_LIBS) -endif - bin_PROGRAMS = gtk3-demo gtk3-demo-application desktopdir = $(datadir)/applications -- 2.30.2